Scatterplot, beacons across the transition


In [1]:
%matplotlib inline
import matplotlib.pyplot as plt

from google.cloud import bigquery
client = bigquery.Client(project='measurement-lab')

q="""

With

Beacons AS (
SELECT
  clientIP,
  node._Instruments AS vers,
  count(*) AS tests,
  MIN(a.MeanThroughputMbps) AS minTput,
  SUM(a.MeanThroughputMbps) /Count(*) AS meanTput,
  MAX(a.MeanThroughputMbps) AS maxTput,
  MIN(a.MinRTT ) AS minMinRTT,
  SUM(a.MinRTT ) /Count(*) AS meanMinRTT,
  MAX(a.MinRTT ) AS maxMinRTT
FROM
  `measurement-lab.ndt.unified_downloads`   -- Remember to test both uploads and downloads
  JOIN `mlab-sandbox.mattmathis.ThousandRandomBeacons4perDay` ON Client.IP = clientIP
WHERE
  test_date BETWEEN '2019-03-01' AND '2020-03-01'
GROUP BY
  node._Instruments, clientIP
),

Paired AS (
SELECT
  NDT5.clientIP,
  NDT5.meanTput AS NDT5meanTput,
  NDT5.maxTput AS NDT5maxTput,
  NDT5.minMinRTT AS NDT5minMinRTT,
  legacy.meanTput AS legacyMeanTput,
  legacy.maxTput AS legacyMaxTput,
  legacy.minMinRTT AS legacyMinMinRTT
FROM ( SELECT * FROM Beacons WHERE vers = 'tcpinfo' ) AS NDT5
JOIN ( SELECT * FROM Beacons WHERE vers = 'web100' ) AS legacy USING ( clientIP )
)

SELECT * FROM Paired

"""
data = client.query(q)

In [2]:
# There must be a better way to do this
NDT5meanTput = []
NDT5maxTput = []
NDT5minMinRTT = []
legacyMeanTput = []
legacyMaxTput = []
legacyMinMinRTT = []
for row in data:
    NDT5meanTput.append(row['NDT5meanTput'])
    NDT5maxTput.append(row['NDT5maxTput'])
    NDT5minMinRTT.append(row['NDT5minMinRTT'])
    legacyMeanTput.append(row['legacyMeanTput'])
    legacyMaxTput.append(row['legacyMaxTput'])
    legacyMinMinRTT.append(row['legacyMinMinRTT'])

In [3]:
# Throughput comparisons
plt.rcParams['figure.figsize'] = [16, 16]
cur = plt.subplot(2, 2, 1)
plt.title('Max Throughput - log log')
plt.loglog([1,800],[1,800], linewidth=1, color='r')
plt.loglog(legacyMaxTput, NDT5maxTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 2)
plt.title('Max Throughput - linear')
plt.plot([0,800],[0,800], linewidth=1, color='r')
plt.plot(legacyMaxTput, NDT5maxTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 3)
plt.title('Mean Throughput - log log')
plt.loglog([1,800],[1,800], linewidth=1, color='r')
plt.loglog(legacyMeanTput, NDT5meanTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 4)
plt.title('Mean Throughput')
plt.plot([0,800],[0,800], linewidth=1, color='r')
plt.plot(legacyMeanTput, NDT5meanTput, color='b', marker='.', linewidth=0)

plt.show()



In [4]:
# Max vs mean for each
plt.rcParams['figure.figsize'] = [16, 16]
cur = plt.subplot(2, 2, 1)
plt.title('New Platform Max vs Mean - log log')
plt.loglog([1,800],[1,800], linewidth=1, color='r')
plt.loglog(NDT5meanTput, NDT5maxTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 2)
plt.title('New Platform Max vs Mean - linear')
plt.plot([0,800],[0,800], linewidth=1, color='r')
plt.plot(NDT5meanTput,NDT5maxTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 3)
plt.title('Old Platform Max  vs Mean - log log')
plt.loglog([1,800],[1,800], linewidth=1, color='r')
plt.loglog(legacyMeanTput, legacyMaxTput, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 4)
plt.title('Old Platform Max vs Mean - linear')
plt.plot([0,800],[0,800], linewidth=1, color='r')
plt.plot(legacyMeanTput, legacyMaxTput, color='b', marker='.', linewidth=0)


Out[4]:
[<matplotlib.lines.Line2D at 0x7fa45c0ae8d0>]

In [5]:
# RTT Comparisons
plt.rcParams['figure.figsize'] = [16, 16]
cur = plt.subplot(2, 2, 1)
plt.title('Min Min RTT - log log')
plt.loglog([1,60],[1,60], linewidth=1, color='r')
plt.loglog(legacyMinMinRTT, NDT5minMinRTT, color='b', marker='.', linewidth=0)
cur = plt.subplot(2, 2, 2)
plt.title('Min Min RTT - linear')
plt.plot([0,60],[0,60], linewidth=1, color='r')
plt.plot(legacyMinMinRTT, NDT5minMinRTT, color='b', marker='.', linewidth=0)

plt.show()



In [ ]: